<template>
    <ContentWrap>
    <el-row justify="end">
        <el-col style="text-align: end;">
            <el-input v-model="content" style="width: 300px;" clearable placeholder="搜索">
                <template #prefix>
                    <Icon icon="ep:search" />
                </template>
            </el-input>
        </el-col>
        <el-col>
            <el-divider />
            <el-table v-loading="loading" :data="list" ref="tableRef">
                <el-table-column label="地震名称" align="center" prop="name" :show-overflow-tooltip="true" width="350" />
                <el-table-column label="发起时间" align="center" prop="createTime" width="300" :show-overflow-tooltip="true" />
                <el-table-column label="参会人员" align="center" prop="content"/>
            </el-table>
            <Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
                @pagination="getList" />
        </el-col>
    </el-row>
</ContentWrap>
</template>

<script lang="ts" setup>
import { getMessageLogList } from '@/api/infoArrive/arriveNotice/messageLog'

const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数
const queryParams = reactive({
    pageNo: 1,
    pageSize: 10,
    pslType:'6'
})

/** 查询列表 */
const getList = async () => {
    loading.value = true
    try {
        const data = await getMessageLogList({ ...queryParams as any ,content:content.value})
        list.value = data.list
        total.value = data.total
    } finally {
        loading.value = false
    }
}

const content = ref('')
/** content */
watch(content, () => {
    queryParams.pageNo = 1;
    getList()
})

onMounted(()=>{
    getList()
})
defineExpose({ getList })
</script>